<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body{
      margin:0;
    }

    .container {
      background: #eee;
      width: 600px;
      height: 1000px;
      margin: 0 auto;
    }

    .sticky-box {
      position: -webkit-sticky;
      position: sticky;
      height: 60px;
      margin-bottom: 30px;
      background: #ff7300;
      top: 0px;
    }

    div {
      font-size: 30px;
      text-align: center;
      color: #fff;
      line-height: 60px;
    }
  </style>
</head>
<body>
<div class="container">
  <div class="sticky-box">内容1</div>
  <div class="sticky-box">内容2</div>
  <div class="sticky-box">内容3</div>
  <div class="sticky-box">内容4</div>
</div>


</body>
</html>
